

# 2-13.编写程序完成公式计算C(n,m)

def fact(a):
	f = 1
	for i in range(1, a + 1):
		f *= i
	return f

def combine(n, m):
	return fact(n)/(fact(m)*fact(n-m))



if __name__ == '__main__':
	# 使用lambda函数对二维列表按第二列排序
	ls = [['a',100],['b',10],['b',30],['d',90],['e',50],]
	print('排序前：')
	print(ls)
	print('排序后：')
	ls.sort(key = lambda x: x[1])
	print(ls)

	print('请输入第一个值：')
	n = eval(input())
	print('请输入第二个值：')
	m = eval(input())
	print(combine(n, m))


